package com.google.code.alpaca.prototype.dao.impl;

import java.util.HashMap;

import javax.inject.Singleton;

import com.google.code.alpaca.prototype.dao.DAOMapping;
import com.google.code.alpaca.prototype.dao.MessageDAO;

@Singleton
public final class DefaultDAOMapping implements DAOMapping {

	private final HashMap<Class<?>, Class<?>> daoMapping;

	DefaultDAOMapping() {
		daoMapping = new HashMap<Class<?>, Class<?>>();

		daoMapping.put(MessageDAO.class, MessageDAOImpl.class);
	}

	@SuppressWarnings("unchecked")
	@Override
	public <T> Class<? extends T> getImplementationType(Class<T> aDaoType) {
		return (Class<? extends T>) daoMapping.get(aDaoType);
	}

}
